<%--<%@ page import="java.util.Enumeration" %>--%>
<%@ page import="java.util.Map" %>
<%--
  Created by IntelliJ IDEA.
  User: HP
  Date: 2019/4/18
  Time: 15:30
  To change this template use File | Settings | File Templates.
--%>
<<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>登陆界面</title>
</head>
<body>
<%
    Map<String,String> userName = (Map<String, String>) request.getSession().getAttribute("user");
    if(userName == null) {
%>
<a href="https://cas.dgut.edu.cn?appid=javaee&state=STATE">登陆</a>
<%
}else{
%>
<a href="/LogoutServlet">登出</a>
<%
    }
%>
<hr>
<%

    if(userName != null)
    {
        String userNameInfo = new String();
        for(String key : userName.keySet()){
            String value = userName.get(key);
            userNameInfo = userNameInfo+ "<p>"+ key + " : "+value + "</p>";
        }
        out.println(userNameInfo);
    }
%>
</body>
</html>